package com.brozha.ans_sys;

import com.brozha.ans_sys.entity.User;
import com.brozha.ans_sys.service.UserService;
import com.brozha.ans_sys.utils.RedisUtils;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @author brozha
 * @since 2021/4/7
 */
@SpringBootTest
public class InitDB {

    @Autowired
    UserService userService;

    @Autowired
    RedisUtils redisUtils;

    @Test
    public void initRoot(){
        User user = new User();
        user.setId("111111");
        user.setUserName("root");
        user.setLevel(0);
        user.setUserPwd("123321123");
        userService.save(user);
    }

    @Test
    public void initRedis(){

        redisUtils.sSet("username","root");
    }

}
